package com.dy.system.service.impl;


import com.dy.system.domain.SysUserMedicalRef;
import com.dy.system.mapper.SysUserMedicalRefMapper;
import com.dy.system.service.ISysUserMedicalRefService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户和角色关联Service业务层处理
 *
 * @author ruoyi
 * @date 2022-08-25
 */
@Service
public class SysUserMedicalRefServiceImpl implements ISysUserMedicalRefService
{
    @Autowired
    private SysUserMedicalRefMapper sysUserMedicalRefMapper;

    /**
     * 查询用户和角色关联
     *
     * @param userId 用户和角色关联主键
     * @return 用户和角色关联
     */
    @Override
    public SysUserMedicalRef selectSysUserMedicalRefByUserId(Long userId)
    {
        return sysUserMedicalRefMapper.selectSysUserMedicalRefByUserId(userId);
    }

    /**
     * 查询用户和角色关联列表
     *
     * @param sysUserMedicalRef 用户和角色关联
     * @return 用户和角色关联
     */
    @Override
    public List<SysUserMedicalRef> selectSysUserMedicalRefList(SysUserMedicalRef sysUserMedicalRef)
    {
        return sysUserMedicalRefMapper.selectSysUserMedicalRefList(sysUserMedicalRef);
    }

    /**
     * 新增用户和角色关联
     *
     * @param sysUserMedicalRef 用户和角色关联
     * @return 结果
     */
    @Override
    public int insertSysUserMedicalRef(SysUserMedicalRef sysUserMedicalRef)
    {
        return sysUserMedicalRefMapper.insertSysUserMedicalRef(sysUserMedicalRef);
    }

    /**
     * 修改用户和角色关联
     *
     * @param sysUserMedicalRef 用户和角色关联
     * @return 结果
     */
    @Override
    public int updateSysUserMedicalRef(SysUserMedicalRef sysUserMedicalRef)
    {
        return sysUserMedicalRefMapper.updateSysUserMedicalRef(sysUserMedicalRef);
    }

    /**
     * 批量删除用户和角色关联
     *
     * @param userIds 需要删除的用户和角色关联主键
     * @return 结果
     */
    @Override
    public int deleteSysUserMedicalRefByUserIds(Long[] userIds)
    {
        return sysUserMedicalRefMapper.deleteSysUserMedicalRefByUserIds(userIds);
    }

    /**
     * 删除用户和角色关联信息
     *
     * @param userId 用户和角色关联主键
     * @return 结果
     */
    @Override
    public int deleteSysUserMedicalRefByUserId(Long userId)
    {
        return sysUserMedicalRefMapper.deleteSysUserMedicalRefByUserId(userId);
    }

    @Override
    public List<Long> selectSysUserMedicalListByUserId(Long userId) {
        return sysUserMedicalRefMapper.selectSysUserMedicalListByUserId(userId);
    }
}
